package cn.tedu.spring.config;

import cn.tedu.spring.auto.UserAuto;
import cn.tedu.spring.file.Database;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestAppConfig {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext
                        (AppConfig.class);
        //获取Database
        Database db = context.getBean(Database.class);
        System.out.println(db);
        //获取UserAuto
        UserAuto user = context.getBean(UserAuto.class);
        System.out.println(user);
    }
}
